#include <windows.h>
#include <stdio.h>
#include "ukonton.h"

#define UKHDR_VER 0x10
#define PLUGIN_NAME "testplugin"
#define PLUGIN_VERS "v0.1"

int init();
char *run(char* args);

BOOL APIENTRY DllMain(HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved){
	switch (ul_reason_for_call){
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
	}
    return TRUE;
}

ukontonModule module =
{
	UKHDR_VER,
	PLUGIN_NAME,
	PLUGIN_VERS,
	init,
	run,
};

__declspec(dllexport) ukontonModule *getModule(){
	return &module;
}

int init(){
	printf("hello world from module\n");
	return 0;
}

char *run(char* args){
	char *buf;
	buf=malloc(sizeof(char)*512+1);
	sprintf_s(buf,512,"\
<html>\
	<head>\
		<title>uKonton</title>\
	<head>\
	<body>\
		<h1>ukonton</h1><hr>\
		personal information manager<br>\
		args='%s'\
	</body>\
</html>\
	",args);
	return buf;
}